package co.yixiang.repository;

import co.yixiang.domain.QiniuContent;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * @author Zheng Jie
 * @date 2018-12-31
 */
public interface QiniuContentRepository extends JpaRepository<QiniuContent,Long>, JpaSpecificationExecutor<QiniuContent> {

    /**
     * 根据key查询
     * @param key 文件名
     * @return QiniuContent
     */
    QiniuContent findByKey(String key);

    /**
     * 根据文件查找数据库存在记录
     * @param key
     * @param suffix
     * @return
     */
    List<QiniuContent> findByKeyAndSuffix(String key,String suffix);
}
